import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'login',
    meta: {
      icon: 'dept',
      title: 'menus.hostManage',
      rank: 11,
      isShow: true
    },
    component: () => import('../views/login/index.vue')
  },
  {
    path: '/main',
    name: 'main',
    meta: {
      title: '主页'
    },
    component: () => import('../layout/index.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          icon: 'dept',
          title: '首页',
          rank: 11,
          isShow: true
        },
        component: () => import('../views/home/index.vue')
      },
      {
        path: '/system',
        name: 'system',
        meta: {
          icon: 'dept',
          title: '系统管理',
          rank: 11,
          isShow: true
        },
        children: [{
          path: '/system/user',
          name: 'user',
          meta: {
            icon: 'dept',
            title: '用户管理',
            rank: 11,
            isShow: true
          },
          component: () => import('../views/system/user/index.vue')
        },
        {
          path: '/system/role',
          name: 'role',
          meta: {
            icon: 'dept',
            title: '角色管理',
            rank: 11,
            isShow: true
          },
          component: () => import('../views/system/role/index.vue')
        },
        {
          path: '/system/dept',
          name: 'dept',
          meta: {
            icon: 'dept',
            title: '部门管理',
            rank: 11,
            isShow: true
          },
          component: () => import('../views/system/dept/index.vue')
        }]
      },
      {
        path: '/host',
        name: 'host',
        meta: {
          icon: 'dept',
          title: '应用主机',
          rank: 11,
          isShow: true
        },
        children: [
          {
            path: '/host/application',
            name: 'App',
            meta: {
              icon: 'dept',
              title: '应用管理',
              rank: 11,
              isShow: true
            },
            component: () => import('../views/host/application/index.vue')
          },
          {
            path: '/host/server',
            name: 'Server',
            meta: {
              icon: 'dept',
              title: '服务管理',
              rank: 11,
              isShow: true
            },
            component: () => import('../views/host/server/index.vue')
          },
          {
            path: '/host/desktop',
            name: 'Desktop',
            meta: {
              icon: 'dept',
              title: '桌面',
              rank: 11,
              isShow: true
            },
            component: () => import('../views/host/desktop/index.vue')
          },
          {
            path: '/host/monitor',
            name: 'monitor',
            meta: {
              icon: 'dept',
              title: '监控',
              rank: 11,
              isShow: true
            },
            component: () => import('../views/host/monitor/index.vue')
          }
        ]
      },
      {
        path: '/demo',
        name: 'demo',
        meta: {
          icon: 'dept',
          title: '测试',
          rank: 11,
          isShow: true
        },
        children: [
          {
            path: '/demo/transition',
            name: 'transition',
            meta: {
              icon: 'dept',
              title: '过渡动画',
              rank: 11,
              isShow: true
            },
            component: () => import('../views/demo/transition.vue')
          }

        ]
      },
      {
        path: '/device',
        name: 'device',
        meta: {
          icon: 'dept',
          title: '设备管理',
          rank: 11,
          isShow: true
        },
        children: [
          {
            path: '/computer/terminal',
            name: 'computer',
            meta: {
              icon: 'dept',
              title: '电脑终端',
              rank: 11,
              isShow: true
            },
            component: () => import('../views/miao/computer/index.vue')
          }

        ]
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
})

export default router
